package com.sfy.core.example.config;

import com.sfy.core.example.fault.retry.RetryStrategyKeys;
import com.sfy.core.example.fault.tolerant.TolerantStrategyKeys;
import com.sfy.core.example.loadbalancer.LoadBalancer;
import com.sfy.core.example.loadbalancer.LoadBalancerKeys;
import com.sfy.core.example.serializer.SerializerKeys;
import lombok.Data;

/**
 * RPC 框架配置
 */
@Data
public class RpcConfig {

    /**
     * 名称
     */
    private String name = "sfy-rpc";

    /**
     * 版本号
     */
    private String version = "1.0";

    /**
     * 服务器主机名
     */
    private String serverHost = "localhost";

    /**
     * 服务器端口号
     */
    private Integer serverPort = 9999;

    /**
     * mock
     */
    private boolean mock = false;

    /**
     * 序列化器
     */
    private String serializer = SerializerKeys.JDK;

    /**
     * 注册中心配置
     */
    private RegistryConfig registryConfig = new RegistryConfig();


    /**
     * 负载均衡策略
     */
    private String loadBalancer = LoadBalancerKeys.ROUND_ROBIN;

    /**
     * 重试策略
     */
    private String retry = RetryStrategyKeys.NO;

    /**
     * 容错机制
     */
    private String tolerantStrategy = TolerantStrategyKeys.FAIL_FAST;
}
